package com.ms.p2p.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * Created by xing_ on 2017/6/17.
 * 借款标产品
 */
public enum LoanStatus {
    STATUS_M5("审核不通过", -5),
    STATUS_0("审核中", 0),
    STATUS_3("招标中", 3),
    STATUS_2("预招标中", 2),
    STATUS_4("满标待审", 4),
    STATUS_5("还款中", 5),
    STATUS_6("结束", 6),
    STATUS_9("持有中", 9);



    private String name;
    private Integer value;
    LoanStatus(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }
    public static  String getNamByValue(String code){
        for(LoanStatus loanstatus : LoanStatus.values()){
            if(StringUtils.equals(code,(loanstatus.getValue()+""))){
                return loanstatus.getName();
            }
        }
        return null;
    }

}
